<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>保存会员资料api、JavsShop标签、API使用手册</title>
<link href="../../stylecss.css" rel="stylesheet" type="text/css" />
</head>

<body>
<!--头部-->
<div id="header">
		<div class="header_top">
		<h1><em>JavsShop</em>文档</h1>
		<div class="title_line">
			<a href="/docs/template_help.html">模板制作手册</a>
			<a href="/docs/api/index.html">API文档</a>
			<a href="/docs/tags/index.html">标签文档</a>
		</div>
	</div>
</div>

<script src="${staticserver}/js/common/jquery-1.8.3.min.js"></script>
<script src="${staticserver}/js/common/jquery-form-2.33.js"></script>
<!-- 获取会员基本信息 -->
<#assign memberInfoTag=newTag("memberInfoTag")>
<!-- 调用会员基本信息 -->
<#assign memberInfo=memberInfoTag()>
<div id="outside">
	<div class="premise">
		<input type="button" value="登录" name="button" id="login"></input>
		<input type="button" value="注销登录" id="logout"></input>
	</div>
<#assign regionSelect = "com.enation.app.shop.core.tag.regions.RegionSelectDirective"?new()>
<form id="addrForm" method="post" action="/api/shop/member!saveinfo.do">
<table width="100%" cellspacing="0" cellpadding="0"	class="perfection addressdo" >
			<tr>
						<th style="vertical-align: text-top;">真实姓名：</th>
						<td colspan="3">
							<input type="text"  name="name" value="" class="input_text" style="border:1px solid #"/>
							<p class="prompt">请务必填写您的真实姓名，以便出现问题时客服核对您的真实信息！</p>
						</td>

					</tr>
					<tr>
						<th style="vertical-align: text-top;">设置头像：</th>
						<td colspan="3">
							<div class="uploadIco">
								<div class="file clearfix">
									<div class="ifUpfile">
										<input type="file" name="faceFile" class="input_text" />
									</div>
									<span id="imgS"></span>
								</div>
								
								<!--file end-->
								<p class="prompt">(建议尺寸120*120像素，200k以内)</p>
								<input name="txtIco" type="hidden" id="txtIco" value="/ajax/MImageHandler.ashx?d=ico\default.jpg" />
							</div>
						</td>
					</tr>
					<tr id="gender">
						<th>性别：</th>
						<td class="middle" colspan="3">
						
							<input type="radio"  name="sex" value="1" style="float:left;display:inline;"/>
							<span style="float:left;display:inline;margin:0px 5px;">男</span>
							
							<input type="radio" value="0"  name="sex" style="float:left;display:inline;"/>
							<span style="float:left;display:inline;margin:0px 5px;">女</span>
							
						</td>
					</tr> 
					<tr>
						<th>生日：</th>
						<td colspan="3" class="birthday middle">
						<input name="mybirthday" type="text" value="" class="input_text" />
							
						</td>
					</tr>
					<tr>
						<th>居住地：</th>
						<td colspan="3" class="choseAddr ">
							<div class="select clearfix"><@regionSelect /></div>
						</td>
					</tr>
					<tr>
						<th>联系地址：</th>
						<td colspan="3" class="birthday middle">
							<input name="address" type="text" value="" class="input_text" />
						</td>
					</tr>
					<tr>
						<th>邮编：</th>
						<td colspan="3" class="birthday middle">
							<input name="zip" type="text" value="" id="zipcode" class="input_text">
						</td>
					</tr>
					<tr>
						<th class="label middle">手机：</th>
						<td colspan="3">
							<input id="cellphone" name="mobile" type="text" value="" class="input_text" />
						</td>
					</tr>
					<tr>
						<th>固定电话：</th>
						<td colspan="3">
							<input id="tel" name="tel" type="text" value="" class="input_text" />
						</td>
					</tr>
					<tr>
						<th></th>
						<td colspan="3">
							<p class="prompt">手机与固定电话至少填写一项</p>
						</td>
					</tr>
				</table>
				<div class="ensure" >
						<input type="submit" name="btnSubmit" value="保存资料" id="btnSubmit" class="userSubmit" />
					</div>
			</form>
								
			<div id="show">		
<h1>输出结果</h1>	
<textarea  id="frm" >
</textarea>
</div>
</div>
	<#include '/docs/fooder.html' />

<!--提交评论-->
<script>
	$(function() {
		var add = "${ctx}/api/shop/member!saveInfo.do";
		$("#btnSubmit").click(function(commadd) {
			$("#addrForm").ajaxSubmit({
				url : add,
				type : "post",
				dataType : "html",
				success : function(result) {
					$("#frm").val(result)
					alert("操作成功")
				},
				error : function(e) {
					alert("操作失败！");
				}
			});
		})
		
		$("#login").click(function(){
			var apiurl="${ctx}/api/shop/member!login.do?username=aaaa&password=aaaaaa";
			$.ajax({
				url:"${ctx}"+apiurl,

				dataType:"json",
				success:function(aa){
					if(aa.result==1){
						alert("恭喜登录成功")
					}
					else{
						alert("用户名和密码错误")
					}
				},
				error:function(){
					alert("api地址错误，请检查");
				}
				
			});
		});
		$("#logout").click(function(){
			var apiurl="${ctx}/api/shop/member!logout.do";
			$.ajax({
				url:"${ctx}"+apiurl,

				dataType:"json",
				success:function(bb){
					if(bb.result==1){
						alert("恭喜注销成功")
					}
					else{
						alert("已经注销过了错误")
					}
				},
				error:function(){
					alert("api地址错误，请检查");
				}
				
			});
		});
	})
</script>
